package com.wx.exam.controller;

import com.wx.exam.pojo.Love;
import com.wx.exam.service.LoveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ychiha
 * @Date 2021/11/26 16:27
 * @Version 1.0
 */
@RestController
public class LoveController {

    @Autowired
    LoveService loveService;

    /**
     * 添加点赞记录
     * @param love
     * @return
     */
    @RequestMapping("/addlove")
    public Boolean addLove(@RequestBody Love love){
        System.out.println("添加点赞信息"+love);
        return loveService.addLove(love);
    }

    /**
     * 移除点赞记录
     * @param love
     * @return
     */
    @RequestMapping("/removelove")
    public Boolean removeLove(@RequestBody Love love){
        System.out.println("移除点赞信息"+love);
        return loveService.removeLove(love);
    }

}
